package com.mk.legoscans2.activities;

import com.mk.legoscans2.LegoScans3Application;
import com.mk.legoscans2.R;
import com.mk.legoscans2.helpers.AccountAlertDialogHelper;

import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.PreferenceActivity;

public class SettingsActivity extends PreferenceActivity  {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferences);
		
		ListPreference prefAccount = (ListPreference)findPreference("prefAccount");
		CharSequence[] entries = AccountAlertDialogHelper.getAccountNames(this);
		prefAccount.setEntries(entries);
		prefAccount.setEntryValues(entries);
		
		CharSequence defaultAccount = LegoScans3Application.AccountService.getDefaultAccountName();
		prefAccount.setDefaultValue(defaultAccount);
	}
}
